/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trefliq.EJB.webservice;

import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import trefliq.EJB.entities.Account;
import trefliq.EJB.sessionbeans.AccountSession;

/**
 *
 * @author eric
 */
//@WebService(serviceName = "AccountWebService")
@Stateless()
public class AccountWebService {
    
    @EJB
    private AccountSession ejbRef;

    @WebMethod(operationName = "getAllAccounts")
    public List<Account> getAllAccounts() {
        return ejbRef.getAllAccounts();
    }

    @WebMethod(operationName = "findAccount")
    public Account findAccount(@WebParam(name = "accountId") Long accountId) {
        return ejbRef.findAccount(accountId);
    }

    @WebMethod(operationName = "createAccount")
    public Account createAccount(@WebParam(name = "account") Account account) {
        return ejbRef.createAccount(account);
    }
    
    @WebMethod(operationName = "editAccount")
    public Account editAccount(@WebParam(name = "account") Account account ){
        return ejbRef.editAccount(account);
    }
    
    @WebMethod(operationName = "deleteAccount")
    public Account deleteAccount(@WebParam(name = "account") Account account ){
        return ejbRef.deleteAccount(account);
    }
    
    @WebMethod(operationName = "deleteAll")
    @Oneway
    public void deleteAll() {
        ejbRef.deleteAll();
    }
}
